package cn.zf233.xcloud.config.common;

import cn.zf233.xcloud.util.SMSUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by zf233 on 2021/3/4
 * SMS 配置类
 */
@Configuration
public class SMSConfig {

    @Value("${alibaba.oss.accessKeyId}")
    private String accessKeyId;

    @Value("${alibaba.oss.accessKeySecret}")
    private String accessKeySecret;

    @Value("${alibaba.sms.templateCode}")
    private String templateCode;

    @Bean
    public SMSUtil smsUtil() {
        SMSUtil smsUtil = new SMSUtil();
        smsUtil.setAccessKeyId(accessKeyId);
        smsUtil.setAccessKeySecret(accessKeySecret);
        smsUtil.setTemplateCode(templateCode);
        return smsUtil;
    }
}